package com.woniu.payback_font.web;

import com.woniu.payback_font.result.ResponseResult;
import com.woniu.payback_font.service.PermissionService;
import com.woniu.payback_font.vo.PermissionMenuVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("permission")
@Api(value = "权限树api接口")
public class PermissionController {

    @Autowired
    PermissionService permissionService;


    @GetMapping("/showPermissionMenu")
    public ResponseResult<List<PermissionMenuVo>> showPermissionMenu(){
        ResponseResult<List<PermissionMenuVo>> result = null;
        List<PermissionMenuVo> menus = permissionService.findPermissionMenus();
        result = new ResponseResult<>(200, "查询成功");
        result.setData(menus);
        return result;
    }

}
